#include "linklist.hpp"

void printList(ListNode* head)
{
	while (head != nullptr)
	{
		cout << head->val << " -> ";
		head = head->next;
	}
	cout << "nullptr" << endl;
}

void addTwoNumbers()
{
	ListNode* l1 = new ListNode(2);
	l1->next = new ListNode(4);
	l1->next->next = new ListNode(3);
	ListNode* l2 = new ListNode(5);
	l2->next = new ListNode(6);
	l2->next->next = new ListNode(4);
	Solution solution;
	ListNode* result = solution.addTwoNumbers(l1, l2);
	printList(result);
}

void swapPairs()
{
	ListNode* head = new ListNode(1);
	head->next = new ListNode(2);
	head->next->next = new ListNode(3);
	head->next->next->next = new ListNode(4);
	Solution solution;
	ListNode* result = solution.swapPairs(head);
	printList(result);
}
